#pragma once
#include <Engine/Math/Vec4.h>
#include <Engine/Math/Vec3.h>

namespace fastbird
{
	class Color
	{
	public:
		Color(){}
		Color(const Vec3& color)
			: mValue(color, 1.0f)
		{
		}
		Color(const Vec4& color)
			: mValue(color)
		{
		}
		Color(float r, float g, float b, float a)
			: mValue(r, g, b, a)
		{
		}

		unsigned int Get4Byte() const
		{
			RGBQUAD color;
			color.rgbRed = BYTE(mValue.x * 255);
			color.rgbGreen = BYTE(mValue.y * 255);
			color.rgbBlue = BYTE(mValue.z * 255);
			color.rgbReserved = BYTE(mValue.w * 255);
			return *(unsigned int*)&color;
		}

		const Vec4& GetVec4() const { return mValue; }

		inline Color operator* (float scalar) const
		{
			return Color(mValue*scalar);
		}

		inline Color operator+ (const Color& r) const
		{
			return mValue + r.GetVec4();
		}

		bool operator== (const Color& other) const
		{
			return mValue==other.mValue;
		}

	private:
		Vec4 mValue;
	};
}